import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'Home',
    component: () => import('@/views/home/index.vue')
  },
  {
    path: '/article/:id',
    name: 'ArticleDetail',
    component: () => import('@/views/article/detail.vue')
  },
  {
    path: '/statistics',
    name: 'Statistics',
    component: () => import('@/views/statistics/index.vue')
  },
  {
    path: '/crawler',
    name: 'Crawler',
    component: () => import('@/views/crawler/index.vue')
  },
  {
    path: '/article/list',
    name: 'ArticleList',
    component: () => import('@/views/article/list.vue'),
    meta: {
      title: '文章列表'
    }
  },
  {
    path: '/qa',
    name: 'QAManagement',
    component: () => import('@/views/qa/index.vue'),
    meta: { title: '问答管理' }
  }
]

export default createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
}) 